package com.system.vote.admin.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.system.vote.common.utils.CustomDateTimeSerializer;
import lombok.Data;

/**
 * 微信用户表
 * @TableName t_wx_userinfo
 */
@TableName(value ="t_wx_userinfo")
@Data
public class TWxUserinfo implements Serializable {
    /**
     * 主键ID
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 使用人微信ID
     */
    @TableField(value = "openid")
    private String openid;

    /**
     * 昵称
     */
    @TableField(value = "nick_name")
    private String nickName;

    /**
     * 用户头像
     */
    @TableField(value = "avatar_url")
    private String avatarUrl;

    /**
     * 最后登录时间
     */
    @JsonSerialize(using = CustomDateTimeSerializer.class)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField(value = "last_login_date")
    private Date lastLoginDate;

    /**
     * 状态：0-启用 1-禁用
     */
    @TableField(value = "status")
    private String status;

    /**
     * 注册时间
     */
    @JsonSerialize(using = CustomDateTimeSerializer.class)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField(value = "register_date")
    private Date registerDate;

    /**
     * 手机号码
     */
    @TableField(value = "phone")
    private String phone;

    /**
     * 密码
     */
    @TableField(value = "password")
    private String password;

    /**
     * 邮箱
     */
    @TableField(value = "email")
    private String email;

    /**
     * uuid
     */
    @TableField(exist = false)
    private String uuid;

    /**
     * 验证码
     */
    @TableField(exist = false)
    private String captcha;

    @TableField(exist = false)
    private TVoteDetail tVoteDetail;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public String toString() {
        return "TWxUserinfo{" +
                "id=" + id +
                ", openid='" + openid + '\'' +
                ", nickName='" + nickName + '\'' +
                ", avatarUrl='" + avatarUrl + '\'' +
                ", lastLoginDate=" + lastLoginDate +
                ", status='" + status + '\'' +
                ", registerDate=" + registerDate +
                ", phone='" + phone + '\'' +
                ", password='" + password + '\'' +
                ", email='" + email + '\'' +
                ", uuid='" + uuid + '\'' +
                ", captcha='" + captcha + '\'' +
                '}';
    }
}